Imports System.Diagnostics.Process
Imports System.Threading
Public Class R_DayPassTranscation
    Dim WithEvents SBO_Application As SAPbouiCOM.Application
    Dim Ocompany As SAPbobsCOM.Company
    Sub New(ByVal ocompany1 As SAPbobsCOM.Company, ByVal sbo_application1 As SAPbouiCOM.Application)
        SBO_Application = sbo_application1
        Ocompany = ocompany1
    End Sub
    Public Sub Attendance_bind_DayPassReport(ByVal oform As SAPbouiCOM.Form)
        Try
          
            oform.DataSources.UserDataSources.Add("oedit4", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
            oform.DataSources.UserDataSources.Add("oedit5", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
      
           
            oEdit = oform.Items.Item("6").Specific
            oEdit.DataBind.SetBound(True, "", "oedit4")
            oEdit = oform.Items.Item("12").Specific
            oEdit.DataBind.SetBound(True, "", "oedit5")
            oEdit.ChooseFromListUID = "CFLBPC"
            oEdit.ChooseFromListAlias = "CardCode"
           
        Catch ex As Exception
            SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
        End Try

    End Sub


    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
        If pVal.FormUID = "TrsDayPassBalanceReport" Then
            oForm = SBO_Application.Forms.Item("TrsDayPassBalanceReport")
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                Dim sCFL_ID As String
                sCFL_ID = oCFLEvento.ChooseFromListUID
                oForm = SBO_Application.Forms.Item(FormUID)
                Dim oCFL As SAPbouiCOM.ChooseFromList
                oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                Try
                    If oCFLEvento.BeforeAction = False Then
                        Dim oDataTable As SAPbouiCOM.DataTable
                        oDataTable = oCFLEvento.SelectedObjects

                        If pVal.ItemUID = "12" Then
                            Try
                                oEdit = oForm.Items.Item("6").Specific
                                oEdit.String = oDataTable.GetValue("CardName", 0)
                                oEdit = oForm.Items.Item("12").Specific
                                oEdit.String = oDataTable.GetValue("CardCode", 0)
                            Catch ex As Exception
                            End Try
                        End If


                    End If
                Catch ex As Exception
                    '' SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                End Try
            End If
        End If
    End Sub
End Class
